/*
 * @Author: your name
 * @Date: 2022-03-29 17:53:50
 * @LastEditTime: 2022-04-07 11:10:52
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \erp_background_system\src\router\orderRouter.js
 */

import { Suspense, lazy } from 'react';
//路由懒加载的封装
const lazyComponent = (path) => {
  const LazyComp = lazy(() => import(`./../${path}`))
  return <Suspense fallback={<div>Loading...</div>}>
    <LazyComp />
  </Suspense>
}


const orderRouter = [
  {
    path: '/order',
    title: '订单管理',
    children: [
      {
        path: '/order/orderList',
        title: '订单列表',
        element: lazyComponent('views/OrderManage/OrderManage.jsx')
      },
      {
        path: '/order/addOrderComm',
        title: '添加订单',
        element: lazyComponent('views/OrderManage/AddOrderComm/AddOrderComm.jsx')
      }, {
        path: '/order/viewOrder',
        title: '查看订单',
        element: lazyComponent('views/OrderManage/ViewOrder/ViewOrder.jsx'),
        pagepermisson: true
      }, {
        path: '/order/modifyOrder',
        title: '修改订单',
        element: lazyComponent('views/OrderManage/ModifyOrder/ModifyOrder.jsx'),
        pagepermisson: true
      }, {
        path: '/order/fillOrder',
        title: '填写订单',
        element: lazyComponent('views/OrderManage/FillOrder/FillOrder.jsx'),
        pagepermisson: true
      }, {
        path: '/order/linkman',
        title: '联系人',
        element: lazyComponent('views/OrderManage/Linkman/Linkman.jsx'),
        pagepermisson: true
      },
    ]
  }
]
export default orderRouter